import React, { Component } from 'react'
import Mytab from '../root/Mytab'
import Touxiang from '../root/Touxiang'
import '../root/business.css'
import pxPage from '../../root/pxPage'
import { getbusidlist, getbuslist, getMsg, getbusidlist_temp } from '../../redux/actionCreator'
import { withRouter } from "react-router-dom"
import { connect } from 'react-redux'
import { Grid } from 'antd-mobile';
import { HashRouter as Router, Route, Switch } from 'react-router-dom'
import Gridbushome from './Gridbushome'
import Addsp from './Addsp'
import Gridbushome_temp from './Gridbushome_temp'
import Modifysp from './Modifysp'
import Modifysp_temp from './Modifysp_temp'
import Modifysp_business from '../Busme/Modify_business'
import {Login_tim} from '../../TIM/actiontim'
// const deviceHight = document.documentElement.clientHeight

// const itemStyl = {
//     height: pxPage(158), width: pxPage(338), backgroundColor: 'black', marginTop: '16px', position: 'relative',
// }

// const dataimg = {
//     width: pxPage(101),
//     height: pxPage(112),
//     position: 'absolute',
//     top: pxPage(20),
//     left: pxPage(10)
// }
// const bushomedataitemspanone = {
//     width: pxPage(220),
//     height: pxPage(27),
//     position: 'absolute',
//     left: pxPage(116),
//     top: pxPage(21),
//     fontSize: pxPage(18)
// }

// const bushomedataitemdivone = {
//     width: pxPage(140),
//     height: pxPage(15),
//     position: 'absolute',
//     left: pxPage(116),
//     top: pxPage(61),
//     fontSize: pxPage(10)
// }

// const bushomedataitemdivtwo = {
//     width: pxPage(140),
//     height: pxPage(15),
//     position: 'absolute',
//     left: pxPage(116),
//     top: pxPage(81),
//     fontSize: pxPage(10)
// }

// const bushomedataitemdivthree = {
//     width: pxPage(140),
//     height: pxPage(15),
//     position: 'absolute',
//     left: pxPage(116),
//     top: pxPage(101),
//     fontSize: pxPage(10)
// }

// const bushomedataitemdivfour = {
//     width: pxPage(30),
//     height: pxPage(21),
//     position: 'absolute',
//     left: pxPage(116),
//     bottom: pxPage(15),
//     fontSize: pxPage(10)
// }

// const bushomedataitemdivfive = {
//     width: pxPage(30),
//     height: pxPage(21),
//     position: 'absolute',
//     left: pxPage(166),
//     bottom: pxPage(15),
//     fontSize: pxPage(10)
// }
// const bushomedataitemdivsix = {
//     width: pxPage(50),
//     height: pxPage(21),
//     position: 'absolute',
//     left: pxPage(216),
//     bottom: pxPage(15),
//     fontSize: pxPage(10)
// }
// const bushomedataitemdivseveb = {
//     width: pxPage(50),
//     height: pxPage(21),
//     position: 'absolute',
//     left: pxPage(266),
//     bottom: pxPage(15),
//     fontSize: pxPage(10)
// }
// const dataitembottomimg = {
//     width: pxPage(44),
//     height: pxPage(44),
// }
class Bushome extends Component {
    constructor(props) {
        super(props);
        // this.props.dispatch(getbusidlist(getMsg(this.props).business_id))//根据商家ID去拿到数据
        // this.props.dispatch(getbuslist())
        // this.props.dispatch(getbusidlist_temp(getMsg(this.props).business_id))
        // Login_tim()
        console.log(props)
    }
    render() {
        return (
            <div className='bushome' style={{ width: '100%', color: 'black', backgroundColor: 'black' }}>
                <Touxiang />
                {
                    <Router>
                        <Switch>
                            <Route exact path='/bushome/' component={Gridbushome} />
                            <Route path='/bushome/release' component={Addsp} />
                            <Route path='/bushome/examine' component={Gridbushome_temp} />
                            <Route path='/bushome/modify/:id' component={Modifysp} />
                            <Route path='/bushome/modify_temp/:id' component={Modifysp_temp} />
                            {/* <Route path='/modify_business' component={Modifysp_business}/> */}
                        </Switch>
                    </Router>
                }
                <Mytab />
            </div>
        )
    }
}
const mapStateToProps = (state) => ({
    login: state.login,
    shop: state.shop,
    business: state.business,
    shop_temp: state.shop_temp,
})
export default withRouter(connect(mapStateToProps)(Bushome))